const express = require('express')
const app = express()
const port = 3006

app.get('/', (req, res) => res.send('Hello World!'))

app.get('/getdata', (req, res) => {
  console.log(req.query, '123');
  let data = {
    message: 'success!',
    name: req.query.name,
    age: req.query.age
  }
  data = JSON.stringify(data)
  res.end('func(' + data + ')');
});

app.listen(port, () => console.log(`Example app listening on port ${port}!`))